// app.js
import ajax from './utils/api.js';
App({
  onLaunch() {
    var _this=this
    _this.globalData.tyurl=ajax.urls,
    _this.jaclx('b_machinery_spec')
    _this.jaclx('hy_check_type')
    _this.jaclx('hy_check_conclusion1')
    _this.jaclx('hy_conclusion')
    _this.jaclx('hy_check_status')
    _this.jaclx('hy_mec_source')
   _this.jaclx('hy_mech_stage')
   _this.jaclx('hy_check_notice_status')
   _this.jaclx('hy_check_accept_status')
   _this.jaclx('hy_CheckChangeType') 
    // 展示本地存储能力
    const logs = wx.getStorageSync('logs') || []
    logs.unshift(Date.now())
    wx.setStorageSync('logs', logs)
    if (!wx.getStorageSync('token')){
        wx.reLaunch({
          url: '/pages/Login/Login',
        })
    }
  },
  jaclx(value){
    var _this=this
    ajax.jaclx({
      typeId:value
    }).then((res) => {
      _this.globalData[value]= res.data
    }).catch((err) => {
      console.log(err)
    });
  },
  globalData: {
    userInfo: null,
    callback: function () {},
  }
})
